<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/common/head.jsp"%>
<%@page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">

<title>出勤显示</title>
<link href="${resource }/css/bootstrap.css" rel="stylesheet">
<link href="${resource }/css/style.css?v=2.2.0" rel="stylesheet">
<link rel="stylesheet" href="${resource }/css/iconfont.css" />
</head>


	<link href="${resource }/css/bootstrap.css" rel="stylesheet">
	<link href="${resource }/css/style.css?v=2.2.0" rel="stylesheet">
	<link rel="stylesheet" href="${resource }/css/iconfont.css" />
	</head>

	

<body style="background-color: #f3f3f4;">
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-sm-4">
					<h2>出勤</h2>
					<ol class="breadcrumb">
						<li><a href="index.jsp">主页</a></li>
						<li><strong>所有出勤</strong></li>
					</ol>
				</div>
			</div>
			<div class="row">
				<div class="col-lg-12">
					<div class="wrapper wrapper-content animated fadeInUp">

						<div class="ibox">
							<div class="ibox-title">
								<h5>所有出勤</h5>

							</div>
							<div class="ibox-content">
								<div class="row m-b-sm m-t-sm">
									<!-- <div class="col-md-1">
										<button type="button" id="loading-example-btn"
											class="btn btn-white btn-sm">
											<i class="fa fa-refresh"></i>刷新
										</button>
									</div>
									<div class="col-md-11">
										<div class="input-group">
											<input type="text" placeholder="请输入日期"
												class="input-sm form-control"> <span
												class="input-group-btn">
												<button type="button" class="btn btn-sm btn-primary">
													筛选</button>
											</span>
										</div>
									</div> -->
								</div>

								<div class="project-list">
										<table class="table table-hover">
											<tbody>
												<tr>
													<td class="project-title">日期</td>
													<td class="project-title">姓名</td>
													<td class="project-title">上班时间</td>
													<td class="project-title">上班签到IP</td>
													<td class="project-title">下班时间</td>
													<td class="project-title">下班签到IP</td>
													<td class="project-title">时长</td>
												</tr>
												<!--循环模块-->
												<c:forEach items="${list }" var="sign">
													<tr>
														<c:if test="${sign.ipDown==null }">
															<c:set var="downtime" value="未下班"></c:set>
															<c:set var="down" value="未下班"></c:set>
															<c:set var="worktime" value="未下班"></c:set>
														</c:if>
														<c:if test="${sign.ipDown!=null }">
															<c:set var="downtime" value="${sign.downTime }"></c:set>
															<c:set var="down" value="${sign.ipDown }"></c:set>
															<c:set var="worktime" value="${sign.workTime }"></c:set>
														</c:if>
														<td class="project-title">${sign.date } </td>
														<td class="project-title">${sign.userName } </td>
														<td class="project-manager">${sign.upTime }</td>
														<td class="project-title">${sign.ipUp }</td>
														<td class="project-list">${downtime }</td>
														<td class="project-title">${down }</td>
														<td class="project-title">${worktime }</td>
													</tr>
												</c:forEach>
												<!--循环模块-->
											</tbody>
										</table>
									</div>
								<!--分页显示-->
									<div class="row">
										<div class="col-md-6">
											<div class="pagination" style="margin: 0px;" role="alert" aria-live="polite" aria-relevant="all">显示 1 到 ${sign.getPages()} 页 记录数${sign.getTotal()}</div>
										</div>
										<!-- 动态分页 -->
										<div class="row">
										<div id="page" class="col-md-6" style="text-align: right;float:right;" ></div>
										</div>
									</div>
									<!--分页显示-->
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="footer">
				<div class="pull-right">
					By： <a href="http://www.zi-han.net" target="_blank">zihan's
						blog</a>
				</div>
				<div>
					<strong>Copyright</strong> H+ &copy; 2014
				</div>
			</div>

		</div>
	</div>
	</div>


	<!-- Mainly scripts -->
	<script src="${resource }/js/jquery-2.1.1.min.js"></script>
	<script src="${resource }/js/bootstrap.min.js?v=3.4.0"></script>
	<script src="${resource }/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script
		src="${resource }/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

	<!-- Custom and plugin javascript -->
	<script src="${resource }/js/hplus.js?v=2.2.0"></script>
	<script src="${resource }/js/plugins/pace/pace.min.js"></script>
	<!-- 分页插件，依赖于jquery位于jquery之后 -->
	<script src="${resource }/js/page.js"></script>

	<script>
	$(document).ready(function() {

	    $('#loading-example-btn').click(function() {
		btn = $(this);
		simpleLoad(btn, true)

		// Ajax example
		//                $.ajax().always(function () {
		//                    simpleLoad($(this), false)
		//                });

		simpleLoad(btn, false)
	    });
	});

	function simpleLoad(btn, state) {
	    if (state) {
		btn.children().addClass('fa-spin');
		btn.contents().last().replaceWith(" Loading");
	    } else {
		setTimeout(function() {
		    btn.children().removeClass('fa-spin');
		    btn.contents().last().replaceWith(" Refresh");
		}, 2000);
	    }
	}
    </script>
     <script >
		$(function(){
				/* 分页插件使用 */
				$("#page").page({/* #page是分页条div的id，调用分页插件page.js中封装的page函数*/
					pageNo:${sign.getPageNo()},/*向page函数传  当前页数，当前页数从controller获取*/
					totalPage:${sign.getPages()},/*向page函数传  总页数，总页数从controller获取*/
					url:"${sign.getUrl()}"/*向page函数传  处理分页的controller地址*/
				});
			}) 
		</script>

</body>

</html>